Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mount whitelist of devices on insecure security mode #1351

Merged
merged 3 commits into from
Feb 14, 2020

Conversation

tonistiigi
Copy link
Member

fixes docker/buildx#220

Unlike docker run --privileged we don't mount all the devices from host because that would give inconsistent environments for different hosts that we would like to avoid (and later solve with constraints). But we can mount a whitelist of devices that are always created by regular distros and commonly used. Permissions are granted to users to read/write all the devices, for the missing ones you just need to mknod the device yourself.

Devices currently created with --security=insecure:

  • kmsg
  • fuse
  • cuse
  • loop-control + loopN
  • net/tun
  • kvm

@tonistiigi
Copy link
Member Author

Copy link
Collaborator

@kunalkushwaha kunalkushwaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall changes LGTM. Will test it separately.

logrus.Debugf("failed to get next free loop device: %v", err)
}

for i := 0; i <= loopID+7; i++ {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any specific reason for these 7 loop devices?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you document this list somewhere?

Copy link
Collaborator

@smira smira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@AkihiroSuda
Copy link
Member

@kunalkushwaha Did you test it?

@kunalkushwaha
Copy link
Collaborator

Tested. LGTM.

@AkihiroSuda AkihiroSuda merged commit 2f5ad30 into moby:master Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

security=insecure does not automatically provide access to devices
5 participants